import axios from '@/utils/http';
import base from './base';

export default {
  // 公告列表
  index(params) {
    return axios.get(
      `${base.sq}/placards`,
      {
        params: {
          page: params.page,
          per: params.per, // 返回多少个
        },
      },
    );
  },
  // 创建公告
  create(params) {
    return axios.post(
      `${base.sq}/placards`,
      {
        title: params.title,
        content: params.content,
      },
    );
  },
  // 删除公告
  delete(params) {
    return axios.delete(
      `${base.sq}/placards/${params.anncId}`,
    );
  },
};
